/*
	File: data/scripts/item_y_translation.nut
	Author: GameStart3d.com
*/

/*!
	@short	ItemYTranslation
	@author	GameStart3d.com
*/
class	ItemYTranslation
{

	timer	=	0.0
	dir		=	1.0
	pos		=	0

	function	OnSetup(item)
	{
		pos = ItemGetPosition(item)
	}

	function	OnUpdate(item)
	{
		local	dt_frame = 1.0 / 60.0
		timer += dt_frame
		pos.y += dir * dt_frame * 5.0
		if (timer > 5.0)
		{
			timer = 0.0
			dir = dir * -1.0
		}

		ItemSetPosition(item, pos)
	}

}
